﻿using System;
using System.Collections.Generic;
using Javavaj.iHunter;

namespace Javavaj.iHunter.Core
{


  

    public class MessageChangedEventArgs : EventArgs
    {
        IMessage header;

        public IMessage Header
        {
            get { return header; }
        }


        public MessageChangedEventArgs(IMessage header)
            : base()
        {
            this.header = header;
        }
    }

    public enum ChannelChangeOperation
    {
        New,
        Delete,
        Modify
    }

    public class ChannelChangedEventArgs : EventArgs
    {
        ChannelChangeOperation operation;

        public ChannelChangeOperation Operation
        {
            get { return operation; }
        }

        IChannel channel;

        public IChannel Channel
        {
            get { return channel; }
        }

        public ChannelChangedEventArgs(IChannel channel, ChannelChangeOperation operation)
            : base()
        {
            this.channel = channel;

            this.operation = operation;
        }
    }



    public delegate void MessageChangedEventHandler(object sender, MessageChangedEventArgs e);
    public delegate void ChannelChangedEventHandler(object sender, ChannelChangedEventArgs e);

    public class EditItemsEventArgs : EventArgs
    {
        private IChannel channel;

        public IChannel Channel
        {
            get { return channel; }
        }

        private IMessage source;
        private KeyValuePair<string, EditItemType>[] replyItems;

        public IMessage Source
        {
            get
            {
                return source;
            }
        }
        public KeyValuePair<string, EditItemType>[] ReplyItems
        {
            get
            {
                return replyItems;
            }
        }
        private string tag;

        public string Tag
        {
            get { return tag; }
        }

        public EditItemsEventArgs(IChannel channel, IMessage source, KeyValuePair<string, EditItemType>[] replyItems,string tag)
            : base()
        {
            this.channel = channel;
            this.source = source;
            this.replyItems = replyItems;
            this.tag = tag;
        }

    }

    public delegate void EditItemsEventHandler(object sender, EditItemsEventArgs e);


    public class ClientEventEventArgs : EventArgs
    {
        public bool critical;
        public bool Critical
        {
            get
            { return critical; }
        }
        string errorMessage;
        public string ErrorMessage
        {
            get
            {
                return errorMessage;
            }
        }
        public ClientEventEventArgs(string message, bool critical)
            :base()
        {
            this.errorMessage = message;
            this.critical = critical;
        }
    }

    public delegate void ClientErrorEventHandler(object sender, ClientEventEventArgs e);
}